package com.yunfeisoft.business.model;

import com.yunfeisoft.base.model.WorkflowInstance;
import com.yunfeisoft.common.base.BaseModel;
import com.yunfeisoft.common.sql.record.TransientField;
import com.yunfeisoft.common.utils.DateUtils;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * ClassName: EmploymentApproval
 * Description: 员工录用审批表
 *
 * @Author: Jackie liu
 * Date: 2020-05-14
 */
@Entity
@Table(name = "TT_EMPLOYMENT_APPROVAL")
public class EmploymentApproval extends BaseModel implements Serializable {

    /**
     * Field serialVersionUID: 序列号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 流程定义id
     */
    @Column
    private String workflowDefineId;

    /**
     * 姓名
     */
    @Column
    private String name;

    /**
     * 岗位
     */
    @Column
    private String position;

    /**
     * 部门
     */
    @Column
    private String dept;

    /**
     * 报道日期
     */
    @Column
    private Date reportDate;

    /**
     * 身份证号
     */
    @Column
    private String idcard;

    /**
     * 性别
     */
    @Column
    private String sex;

    /**
     * 学历
     */
    @Column
    private String degree;

    /**
     * 毕业院校
     */
    @Column
    private String school;

    /**
     * 专业
     */
    @Column
    private String major;

    /**
     * 劳动合同开始时间
     */
    @Column
    private Date contractBeginDate;

    /**
     * 劳动合同结束时间
     */
    @Column
    private Date contractEndDate;

    /**
     * 试用期开始时间
     */
    @Column
    private Date trialBeginDate;

    /**
     * 试用期结束时间
     */
    @Column
    private Date trialEndDate;

    /**
     * 试用周期
     */
    @Column
    private Integer trialPeriod;

    /**
     * 试用工资
     */
    @Column
    private BigDecimal trialSalary;

    /**
     * 转正工资
     */
    @Column
    private BigDecimal regularSalary;

    /**
     * 社保基数
     */
    @Column
    private BigDecimal socialSecurityBase;

    /**
     * 备注
     */
    @Column
    private String remark;

    @TransientField
    private Integer validStatus;
    @TransientField
    private String createName;
    //下一节点处理人
    private String nextStepUserId;

    public String getContractBeginDateStr() {
        if (contractBeginDate != null) {
            return DateUtils.dateToString(contractBeginDate);
        }
        return null;
    }

    public String getContractEndDateStr() {
        if (contractEndDate != null) {
            return DateUtils.dateToString(contractEndDate);
        }
        return null;
    }

    public String getTrialBeginDateStr() {
        if (trialBeginDate != null) {
            return DateUtils.dateToString(trialBeginDate);
        }
        return null;
    }

    public String getTrialEndDateStr() {
        if (trialEndDate != null) {
            return DateUtils.dateToString(trialEndDate);
        }
        return null;
    }

    public String getReportDateStr() {
        if (reportDate != null) {
            return DateUtils.dateToString(reportDate);
        }
        return null;
    }

    public String getValidStatusStr() {
        return WorkflowInstance.WorkflowInstanceStatusEnum.valueOf(validStatus);
    }

    public String getWorkflowDefineId() {
        return workflowDefineId;
    }

    public void setWorkflowDefineId(String workflowDefineId) {
        this.workflowDefineId = workflowDefineId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getDept() {
        return dept;
    }

    public void setDept(String dept) {
        this.dept = dept;
    }

    public Date getReportDate() {
        return reportDate;
    }

    public void setReportDate(Date reportDate) {
        this.reportDate = reportDate;
    }

    public String getIdcard() {
        return idcard;
    }

    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getDegree() {
        return degree;
    }

    public void setDegree(String degree) {
        this.degree = degree;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public String getMajor() {
        return major;
    }

    public void setMajor(String major) {
        this.major = major;
    }

    public Date getContractBeginDate() {
        return contractBeginDate;
    }

    public void setContractBeginDate(Date contractBeginDate) {
        this.contractBeginDate = contractBeginDate;
    }

    public Date getContractEndDate() {
        return contractEndDate;
    }

    public void setContractEndDate(Date contractEndDate) {
        this.contractEndDate = contractEndDate;
    }

    public Date getTrialBeginDate() {
        return trialBeginDate;
    }

    public void setTrialBeginDate(Date trialBeginDate) {
        this.trialBeginDate = trialBeginDate;
    }

    public Date getTrialEndDate() {
        return trialEndDate;
    }

    public void setTrialEndDate(Date trialEndDate) {
        this.trialEndDate = trialEndDate;
    }

    public Integer getTrialPeriod() {
        return trialPeriod;
    }

    public void setTrialPeriod(Integer trialPeriod) {
        this.trialPeriod = trialPeriod;
    }

    public BigDecimal getTrialSalary() {
        return trialSalary;
    }

    public void setTrialSalary(BigDecimal trialSalary) {
        this.trialSalary = trialSalary;
    }

    public BigDecimal getRegularSalary() {
        return regularSalary;
    }

    public void setRegularSalary(BigDecimal regularSalary) {
        this.regularSalary = regularSalary;
    }

    public BigDecimal getSocialSecurityBase() {
        return socialSecurityBase;
    }

    public void setSocialSecurityBase(BigDecimal socialSecurityBase) {
        this.socialSecurityBase = socialSecurityBase;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getValidStatus() {
        return validStatus;
    }

    public void setValidStatus(Integer validStatus) {
        this.validStatus = validStatus;
    }

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public String getNextStepUserId() {
        return nextStepUserId;
    }

    public void setNextStepUserId(String nextStepUserId) {
        this.nextStepUserId = nextStepUserId;
    }
}